import React from 'react'
interface PropsType {
	flag: boolean
	count: number,
	addCount: Function
}


export default class Demo extends React.Component<PropsType> {
	constructor(props) {
		super(props)
		console.log('子 constructor');
	}
	render(): React.ReactNode {
		console.log('子 render');
		return (
			<button onClick={ () => this.props.addCount() }>++++1</button>
		)
	}
	componentDidMount() {
		console.log('子 componentDidMount');

	}
	shouldComponentUpdate() {
		console.log('子 shouldComponentUpdate');

		return true
	}
	componentDidUpdate() {
		console.log('子 componentDidUpdate');
	}
	componentWillUnmount() {
		console.log('componentWillUnmount')
	}
}